<?php

class Controller_Email extends Controller_Template {

    public function action_index() {

        var_dump($_REQUEST);
//        $this->action_sendmail();
        $this->template->title = 'Contact us';
        $this->template->content = View::forge('email/index');
    }

   

    public function action_sendmail() {


        $subject = Input::post('subject');
        $body = Input::post('message');
        
        $email = Email::forge();
        $email->to('binhnt.0513@gmail.com');
        $email->from('binhnt.0513@gmail.com');
        $email->subject($subject);
        $email->body($body);
        if ($email->send()) {
            echo 1;
//            return Response::forge(View::forge('email/thank-you'));
        } else
            echo 2;
    }
}
